package cn.mesmile.flow.customlisten;

import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * @author zb
 * @date 2020/12/26 10:48
 * @Description
 */
@Component
public class EmailListener implements ApplicationListener<EmailEvent> {

    @Override
    public void onApplicationEvent(EmailEvent emailEvent) {
        Object source = emailEvent.getSource();
        /**
         *  邮件监听器，一旦有邮件事件，则会触发此处
         */
        System.out.println("邮件地址：" + emailEvent.getEmail());
        System.out.println("邮件内容：" + emailEvent.getContent());
    }

}
